import React from 'react';


//hash模式 /后面有个#
// import {HashRouter as Router,link,Route} from 'react-router-dom'

//host模式 /后端配合使用
import {BrowserRouter as Router,Link,Route} from 'react-router-dom'


function Home() {
  return (
    <div className="App">
     <h1>admi首页</h1>
    
    </div>
  );
}
function Me() {
  return (
    <div className="Me">
     <h1>admin个人</h1>
    
    </div>
  );
}
function Prouct() {
  return (
    <div className="Prouct">
     <h1>admin产品</h1>
    
    </div>
  );
}

class App extends React.Component{
  render(){
    return(
      <div id='app'>
        <div>所有页面内容</div>
        <Router>

          <Route path='/'exact component={()=>(<div>首页</div>)}></Route>
          <Route path='/Me' component={()=>(<div>me</div>)}></Route>
          <Route path='/Prouct' component={()=>(<div>产品</div>)}></Route>
        </Router>

        <Router basename='/admin'>
        <div className='nav'>
          <Link to='/'>Home</Link>
          <Link to='/Prouct'>Prouct</Link>
          <Link to='/Me'>个人中心</Link>
        </div>
        <Route path='/' exact component={Home}></Route>
        <Route path='/Prouct' component={Prouct}></Route>
        <Route path='/Me' component={Me}></Route>
        </Router>
      </div>
    )
  }
}


export default App;
